<template>
  <section class="page">
    <headerbar>{{data.pxbmc}}
<!--      <span v-if="!noticeType" class="head-btn" @click="goDetail()" slot="btn">通知情况</span>-->
    </headerbar>

    <section class="inner-content">
      <section class="detail">
        <h1 class="title">{{data.pxbmc}}</h1>
<!--        <p class="date">{{getTime(data.createTime)}} <span class="pull-right">发送者：{{data.senderName}}</span></p>-->
        <p class="line"></p>
        <div class="default-text line-my">主办单位：<span>{{ data.zbdw }}</span>
        </div>
        <div class="default-text line-my">
          培训对象：<span>{{ data.pxdx }}</span>
        </div>
        <div class="default-text line-my">
          培训人数：<span>{{ data.pxrs }}人</span>
        </div>
        <div class="default-text line-my">
          培训地点：<span>{{ data.pxdd }}</span>
        </div>
        <div class="default-text line-my">
          培训类别：<span> {{data.pxlb }}</span>
        </div>
        <div class="default-text line-my">
          培训起止时间：<span>{{ getDay(data.pxkssj) }} - {{getDay(data.pxjssj) }}</span>
        </div>
        <div class="default-text line-my">
          培训地点：<span>{{data.pxdd}}</span>
        </div>
        <div class="default-text line-my">
          培训学时：<span>{{ data.pxxs }}</span>
        </div>
        <div class="default-text line-my">
          培训方式及渠道：<span>{{ data.pxfsjqd }}</span>
        </div>
        <div class="default-text line-my">
          投入经费：<span>{{ data.trjf }}</span>
        </div>
        <div class="default-text line-my">
          是否出过出境培训：<span>{{ data.sfcgcjpx }}</span>
        </div>
        <div class="default-text line-my">
          是否对口支援培训：<span>{{ data.sfdkzypx }}</span>
        </div>
        <div class="default-text line-my">
          培训类型：<span>{{ data.pxlx }}</span>
        </div>
        <div class="default-text line-my">
          教学安排：<span v-html="data.jxap"/>
        </div>
        <div class="default-text line-my" >
          培训内容：<span v-html="data.pxnr"/>
        </div>
        <p class="pdv-2"></p>

        <div @click="save()" class="default-block-btn">点击报名</div>
      </section>
    </section>
  </section>
</template>

<script>
import tools from '@/utils/tools'
import api from '@/common/config/api'
import loginService from '@/service/loginService'
import moment from 'moment'

export default {
  name: 'partyEducationDetail',
  data () {
    return {
      fn: tools,
      data: {},
      id: '',
      files: [],
      attachmentList: [],
      noticeType: true,
      tabIndex: '0',
      feedType: false ,//是否需要反馈
      userInfo:'',
    }
  },
  created () {
    this.userInfo = this.$localStorage.get('userInfo')
    this.id = this.$route.params.id
    this.tabIndex = this.$route.params.tabIndex
    this.noticeType = this.$store.state.showFeedback
    this.loadData()
    // this.optNodeMsgRead()
  },
  methods: {
    loadData () {
      this.fetchService.trainClassDetail(this.id).then(res => {
        if (res.code !== 0) {
          return tools.tip(res.message)
        }
        this.data = res.data
      })
    },
    getTime (createTime) {
      return moment(createTime).format('YYYY年MM月DD日')
    },
    getDay(createTime) {
      return moment(createTime).format("YYYY年MM月DD日");
    },
    imgUrl (fileId) {
      return this.tools.getImgUrl(fileId)
    },
    showImagePreview (item) {
      if (item.fileId.length < 1) {
        return false
      }
      let fileUrl = this.tools.getImgUrl(item.fileId)
      item.url = fileUrl
      let imgs = [fileUrl]
      this.$createImagePreview({
        initialIndex: 0,
        imgs: imgs
      }, (h) => {
        return h('div', {
          class: {
            'image-preview-custom-header': false
          },
          slot: 'header'
        }, '')
      }).show()
    },
    save(){
      this.$router.push({
        path: `/partyEducationSignUp/${this.id}`,
      })
    },
    goFeedback () {
      this.$createFeedbackDialog({
        $props: {
          id: this.id,
          msgType: this.data.msgType
        }
      })
//        this.go()
    },
    goDetail () {
      this.$router.push({path: `/noticeNoticePeople/${this.id}`})
    },
    goDetailsanhuiyike (data) {
      this.fetchService.meet_getMeetIdByid(this.id).then(res => {
        console.log('meet_getMeetIdByid',res.data);
        this.$router.push({ path: `/sanhuiyikeDetail/${res.data.entityId}`, query:{fromType: 'zzsh'} });
      })
    },
    optNodeMsgRead () {
      let data = {
        id: this.id
      }
      this.fetchService.optNodeMsgRead(data).then(res => {
      })
    }
  }
}
</script>

<style scoped lang="scss">
.detail .cont-text {
  font-family:dang;
}
.party-detail{
  color: #0f9ceb;
  line-height: 2em;
  font-size: 16PX;
}
.detail .title {
  align-items: center;
  display: flex;
  justify-content: center;
}
.line-my{
  line-height: 0.8rem;
  font-size: 16PX;
  font-weight: bold;
  font-family: PingFang SC,miui,system-ui,-apple-system,BlinkMacSystemFont,Helvetica Neue,Helvetica,sans-
}
</style>
